﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _114_有多少个矩形的面积超过100平米_LINQ扩展方法
{
    class Program
    {
        static void Main(string[] args)
        {
            Rectangle[] 我爱编程 =
            {
                new Rectangle{Width=16.002f,Height=7f},
                new Rectangle{Width=2.5f,Height=4.74f },
                new Rectangle{Width=1.5f,Height=3.5f},
                new Rectangle{Width=6.9f,Height=12.3f},
                new Rectangle{Width=0.8f,Height=12.3f},
                new Rectangle{Width=9.4f,Height=21.3f},
                new Rectangle{Width=6.5f,Height=32.8f}
            };
            //求面积大于100平米的矩形个数
            int 个数 = 我爱编程.Count(r => (r.Width * r.Height) > 100f);
            Console.WriteLine("面积大于100平米的矩形数：{0}个",个数);
        }


    }

    public struct Rectangle
    {
        public float Width;
        public float Height;
    }
}
